{% extends 'mainapp/base.html' %}
{% load static %}

{% block container %}
    <div class="hero-white">
        {% include 'mainapp/includes/main_menu.html' %}
    </div>

    <div class="details">
        {% include 'mainapp/includes/catalog_menu.html' %}

        <div class="related">
            <div class="title clearfix">
                <h2>Продукты категории {{ category.name|upper }}</h2>
                <div class="paginator">
                    {% if products.has_previous %}
                        <a href="{% url 'main:category' category.pk %}?page={{ products.previous_page_number }}">
                            <
                        </a>
                    {% endif %}
                    <span class="current">страница {{ products.number }} из {{ products.paginator.num_pages }}</span>
                    {% if products.has_next %}
                        <a href="{% url 'main:category' category.pk %}?page={{ products.next_page_number }}">
                            >
                        </a>
                    {% endif %}
                </div>
            </div>
            <div class="related-products clearfix">
                {% for item in products %}
                    <div class="block">
                        <a href="{% url 'main:product_page' item.pk %}">
                            <img src="/media/{{ item.image }}" alt="">
                            <div class="text">
                                <img src="/static/img/icon-hover.png" alt="img">
                                <h4>{{ item.name }}</h4>
                                <p>{{ item.short_desc }}</p>
                            </div>
                        </a>
                    </div>
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock %}
